<?php

if(@$_GET['arrxmlsection']){
	
	$language = "";
	
	if(@$_GET['language']){
	
		$language = $_GET['language'];	
	}
	
	$strXmlSection = $_GET['arrxmlsection'];
	
	$arrXmlSection = explode("||",$strXmlSection);
	
	array_pop($arrXmlSection);
	
	foreach($arrXmlSection as $value){
		
		$contentExport = "<?phpxml version=\"1.0\" encoding=\"ISO-8859-1\"?>";//initial output variable 
		
		$currentXML = getAllXmlTags($language,$value);//get xml tags object on the basis of language and section variable
		
		createXMLIteration("");
		
		//addContent(str_replace("../assets/xml","../assets/junkbox"."/".$language,$value));
		
		deleteFile1(str_replace("../assets/xml","../assets/junkbox"."/".$language,$value));
		
		if(createDirectory("../assets/junkbox/",$language)){
			
			addContent("create directory");
		}
		else{
			
			addContent("not create");
		}
		
		$dirTree = str_replace("../assets/xml/","",$value);
		
		$arrDirTree = explode("/",$dirTree);
		
		array_pop($arrDirTree);
		
		$tmpPath = "../assets/junkbox/".$language;
		
		foreach($arrDirTree as $itemDirTree){
			
			//addContent($tmpPath."/".$itemDirTree."#");
			
			if(createDirectory($tmpPath."/",$itemDirTree)){
				
				addContent("create directory ".$itemDirTree."#");	
				$tmpPath .= "/".$itemDirTree;
			}
			else{
				
				$tmpPath .= "/".$itemDirTree;
				addContent("not create".$itemDirTree."#");
			}
		}
		
		if(createFile1(str_replace("../assets/xml","../assets/junkbox"."/".$language,$value),$contentExport)){
			
			addContent("we made it");
		}
		else{
			
			addContent("sorry");
		}
		
		//addContent($contentExport);
//	
//		addContent("aaa:".$value."<br/>");
	}
	
	//addContent($arrXmlSection);

}



?>